﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using System.Windows.Forms;

namespace DieuTriNoiTru.includes
{
    class connection
    {
        public SqlConnection conn = null;
        public void Open()
        {
            try
            {
                string connect = @"Data Source=NOLOVE-PC\SQLEXPRESS;Initial Catalog=quanlybenhan;Integrated Security=True";
                conn = new SqlConnection(connect);
                conn.Open();
                MessageBox.Show("Ket noi thanh cong");
            }
            catch
            {
                MessageBox.Show("Ket noi k thanh cong");
            }
        }
        public void Close()
        {
            try
            {
                String connect = @"Data Source=NOLOVE-PC\SQLEXPRESS;Initial Catalog=quanlybenhan;Integrated Security=True";
                conn = new SqlConnection(connect);
                conn.Close();
            }
            catch
            {
            }
        }
    }
}
